<template lang="">
  <div>
      <!-- 渲染API -->
  <RenderTest />
  </div>
</template>
<script>
import { h } from '@vue/runtime-core'
export default {
  props: {
    counter: {
      type: Number,
      default: 1
    }
  },
  components: {
    RenderTest: {
      props: {
        conter: {
          type: Number,
          default: 0
        }
      },
      render () {
        const emit = this.$emit
        const self = this;
        return h('div', [
          h('div', {
            onClick () {
              emit('update:counter', self.conter + 1)
            }
          }, `I am RenderTest: ${self.conter}`),
          h('a', { href: 'http://www.baidu.com' }, 'I am a'),
        ])
      }
    }
  }
}
</script>
<style lang="">
</style>